﻿@model IEnumerable<KCMS.BusinessLogic.Models.ProductImage>
@using KCMS.Helpers

<table id="product-image-list">
    <tr>
        <th>
            Product
        </th>
        <th>
            Color
        </th>
        <th>
            ThumbImageFile
        </th>
        <th>
            DateOfCreate
        </th>
        <th>
            DateOfChange
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @item.Product.Article @item.Product.Title @item.Product.Brend.Title
            </td>
            
            <td>
                @Html.DisplayFor(modelItem => item.Color)
            </td>
            <td>
                @if (item.ColorImageFile != null)
                {
                    <img src="@Url.ContentImageUpload(@item.ColorImageFile)" style="width:64px;height:64px;"/>
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DateOfCreate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DateOfChange)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })
            </td>
        </tr>
    }
</table>

